Skip to content

Migrate scala3doc to compiler's parser #10462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

romanowski
Copy link
Contributor

No description provided.

@romanowski romanowski force-pushed the scala3doc/use-dotty-argument-parser branch from a9a55ac to b7ca68f Compare November 24, 2020 01:08
"--projectTitle", ctx.settings.projectName.value,
"--dest", ctx.settings.outputDir.value.toString,
)
val (filesToCompile, ctx) = setup(args, rootCtx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romanowski this doesn't work, we need to parse the arguments ourselves first, then "forward" them to compiler settings. Otherwise the compiler will emit errors on Scala3doc-specific args. I can take a look at that later today.

@romanowski romanowski force-pushed the scala3doc/use-dotty-argument-parser branch 2 times, most recently from f7373b3 to 454ecd7 Compare November 26, 2020 20:28
Copy link
Contributor

@abgruszecki abgruszecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks really good, I have only some small comments.

@@ -1549,7 +1550,7 @@ object Build {
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
else generateDocumentation(
roots, "Scala 3", "scala3doc/output/scala3-stdlib", "maser",
"-p scala3doc/scala3-docs --syntax wiki --projectLogo scala3doc/scala3-docs/logo.svg "
"-siteroot scala3doc/scala3-docs -comment-syntax wiki -projec-logo scala3doc/scala3-docs/logo.svg "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/projec-logo/project-logo

val pluginsDir: Setting[String] = StringSetting ("-Xpluginsdir", "path", "Path to search for plugin archives.", Defaults.scalaPluginPath)
val pluginOptions: Setting[List[String]] = MultiStringSetting ("-P", "plugin:opt", "Pass an option to a plugin, e.g. -P:<plugin>:<opt>")

/** Doctool specific settings */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we move these to Scala3doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is used by tastdoc so as long as it exisits we can't

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dottydoc, you mean? I guess then we should move it in a PR that deletes Dottydoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor

@BarkingBad BarkingBad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok

@romanowski romanowski force-pushed the scala3doc/use-dotty-argument-parser branch from 454ecd7 to 35f3e12 Compare November 28, 2020 13:13
@romanowski
Copy link
Contributor Author

@nicolasstucki could you take a look at changes in TastyInspector?

Copy link
Contributor

@abgruszecki abgruszecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM.

* @param classes List of paths of `.tasty` and `.jar` files (no validation is performed)
* @param classpath Classpath with extra dependencies needed to load class in the `.tasty` files
*/
protected def inspectFilesInContext(classpath: List[String], classes: List[String])(using Context): Unit =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should hide this definition from the user-facing API, having it here just opens a can of worms we'd prefer to have closed.

How about:

  1. we make inspectorDriver private[inspector]
  2. we create class DocTastyInspector extends TastyInspector in pkg scala.tasty.inspector.internal
  3. we move this definition to said new class
  4. we use that class in the doctool instead of the usual inspector

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in: 2cd20e4

@romanowski romanowski merged commit 0f0137e into scala:master Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants